
# README for replication data for: Estimating the persistence of party cue influence in a panel survey experiment

# Run below code to reproduce the results in the manuscript and online appendix
# Please refer to the individual scripts for additional details

library(brms)
library(tidyverse)
library(tidybayes)
library(cowplot)
library(broom)
library(papaja)
library(lme4)
library(broom.mixed)

set.seed(42)

# Replication code for all results reported in the manuscript and online appendix, except the attrition results and power analysis (see below)
# Approx. runtime: 120 minutes (on a standard laptop), due to the fitting of the Bayesian multilevel models
source("analysis_primary_odc.R")

# Replication code to reproduce the results of the attrition analysis reported in the online appendix
# Approx. runtime: <1 minute
source("analysis_attrition_odc.R")

# Replication code to reproduce the results of the sensitivity power analysis reported in the online appendix
# Approx. runtime: 15 minutes
source("analysis_sensitivity_power.R")


# Additional notes ----

# The data are provided in files "data_odc.rds" and "data_odc.csv" (both .rds and .csv formats are provided for convenience)
# The codebook for the data is in file "codebook.xlsx"

